package net.lummox.service;

import java.util.HashMap;

import javax.ejb.Remote;
import javax.ejb.Stateless;

import net.lummox.command.Command;

@Stateless
@Remote(CommandService.class)
public class CommandServiceImpl implements CommandService {
	
	private HashMap<String, Command> commandMap = new HashMap<String, Command>();
	
	public CommandServiceImpl() {
		super();
	}		

	@Override
	public Command find(String commandName) {		
		return commandMap.get(commandName);
	}

	@Override
	public void add(Command command) {
		commandMap.put(command.getName(), command);
	}
}